package com.tao.ifdemo2;

import java.util.Scanner;

public class IfDemo1 {
    public static void main(String[] args) {
        // 定义年龄变量
        int age;
        Scanner input = new Scanner(System.in);
        System.out.println("输入年龄");
        age = input.nextInt();
        // 判断
        if (age >= 18) {
            System.out.println("已成年");
        } else {
            System.out.println("未成年");
        }
        System.out.println("-------------------");
        int num;
        System.out.println("输入一个数");
        num = input.nextInt();
        if (num >= 5 && num <= 10) {
            System.out.println("在[5,10]区间");
        } else {
            System.out.println("不在[5,10]区间");
        }
    }
}
